package leetcodev1.字符串;

public class LeetCode171 {
    public int titleToNumber(String columnTitle) {
        int ret = 0, length = columnTitle.length(), index = length - 1, multiple = 1;
        while (index >= 0) {
            int num = columnTitle.charAt(index) - 'A' + 1;
            ret += num * multiple;
            multiple *= 26;
            index--;
        }
        return ret;
    }
}
